package com.bpmn.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 超时策略枚举类
 *
 * @author rain
 */
@Getter
@AllArgsConstructor
public enum TimeoutStrategy {
    AUTO_PASS("auto_pass", "自动通过"),
    AUTO_REJECT("auto_reject", "自动拒绝"),
    ALERT("alert", "仅提醒");

    private final String value;
    private final String message;

    public static TimeoutStrategy fromValue(String value) {
        for (TimeoutStrategy strategy : TimeoutStrategy.values()) {
            if (strategy.getValue().equals(value)) {
                return strategy;
            }
        }
        throw new IllegalArgumentException("Unknown timeout strategy: " + value);
    }
}
